<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    @if(!$name)
        <title>调用说明</title>
    @else
        <title>{{ $name }} 调用说明</title>
    @endif
    <style>
        * {
            margin: 0;
            padding: 0;
            color: #efefef;
            text-decoration: none;
        }

        body {
            background: #20242f;
            display: flex;
            justify-content: space-between;
            height: 100%;
        }

        #left {
            width: 20%;
            height: 100%;
            padding: 30px 0;
        }

        #left ul {

        }

        #left ul li {
            list-style: none;
            padding: 10px;
        }

        #left ul li:hover {
            background: #151924;
        }

        #left ul li a {
            display: block;
            font-size: 14px;
        }

        #right {
            width: 80%;
            padding: 40px;
            border-left: 1px solid #333;
        }

        #right h1 {
            border-bottom: 3px solid #ff552e;
            padding: 20px 0;
            margin-bottom: 30px;
        }

        #right .methods {
            display: flex;
            justify-content: space-around;
            flex-wrap: wrap;
        }

        #right .methods dl {
            background: #424754;
            padding: 20px;
            border-radius: 30px;
            margin: 10px;
        }

        #right .methods dt {
            margin-bottom: 10px;
            font-size: 20px;
            border-left: 3px solid #999;
            text-indent: 10px;
            color: #fff;
        }

        #right .methods dd {
        }

        #right .methods dd pre {
            font-family: '微软雅黑';
            font-size: 12px;
            line-height: 20px;
        }
    </style>
</head>
<body>
<div id="left">
    <ul class="types">
        @foreach($types as $typeName=>$tag)
            <li>
                <a href="/_help/{{ $tag }}">🔖 {{ $typeName }} </a>
            </li>
        @endforeach
    </ul>
</div>
<div id="right">
    @if ($name)
        <h1>miya("{{ $name }}")</h1>

        <div class="methods">
            @foreach(miya($name)->helpData() as $method=>$value)
                <dl class="help">
                    <dt>{{ $method }}({{ implode(',',$value['parms']) }})</dt>
                    <dd>
                        <pre>{{ $value['doc'] }}</pre>
                    </dd>
                </dl>
            @endforeach
        </div>
    @else
        <script>
            location.href = '/_help/area';
        </script>
    @endif
</div>
<script>
    window.onload = () => {
        let height = document.body.scrollHeight;
        console.log(height);
        let right = document.getElementById('right');
        right.style.height = height + 'px';
    }
</script>
</body>
</html>
